package com.toby.service.impl;

import com.toby.dao.LogDao;
import com.toby.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @desc: 日志Service
 * @author: jonathan.zhang
 * @date: 2019/10/8 23:00
 */
@Service
public class LogServiceImpl implements LogService {
    @Autowired
    private LogDao logDao;
    @Override
    @Transactional(propagation = Propagation.NESTED,rollbackFor = Exception.class)
    public void addLog(String operation) {
        logDao.addLog(operation);
        System.out.println(1/0);
    }
}
